<template>
  <div class="comic-container">
    <!-- 头部banner -->
    <div class="comic-banner">
      <div class="banner-overlay"></div>
      <div class="banner-content">
        <h1 class="banner-title">漫画频道</h1>
        <p class="banner-subtitle">探索精彩漫画世界，发现你的二次元乐趣</p>
      </div>
    </div>

    <!-- 内容分类标签 -->
    <div class="comic-categories">
      <button 
        v-for="category in categories" 
        :key="category.id"
        class="category-tab"
        :class="{ active: activeCategory === category.id }"
        @click="activeCategory = category.id"
      >
        {{ category.name }}
      </button>
    </div>

    <!-- 热门漫画轮播 -->
    <div class="popular-comics-section">
      <div class="section-header">
        <h2>热门推荐</h2>
        <a href="#" class="more-link">更多推荐 <i class="fa fa-angle-right"></i></a>
      </div>
      <div class="carousel-container">
        <div class="carousel-track" :style="{ transform: `translateX(-${carouselIndex * 100}%)` }">
          <div v-for="comic in popularComics" :key="comic.id" class="carousel-item">
            <div class="comic-card-large">
              <img :src="comic.image" :alt="comic.title" class="comic-cover-large">
              <div class="comic-info-large">
                <div class="comic-rating">
                  <span class="rating-number">{{ comic.rating }}</span>
                  <span class="rating-text">评分</span>
                </div>
                <h3 class="comic-title-large">{{ comic.title }}</h3>
                <p class="comic-description">{{ comic.description }}</p>
                <div class="comic-details">
                  <span class="detail-item">{{ comic.author }}</span>
                  <span class="detail-item">{{ comic.status }}</span>
                  <span class="detail-item">{{ comic.updateFrequency }}</span>
                </div>
                <div class="comic-genres">
                  <span 
                    v-for="genre in comic.genres" 
                    :key="genre"
                    class="genre-tag"
                  >
                    {{ genre }}
                  </span>
                </div>
                <div class="comic-actions">
                  <button class="read-now-btn">
                    <i class="fa fa-book"></i> 立即阅读
                  </button>
                  <button class="add-bookshelf-btn">
                    <i class="fa fa-plus"></i> 加入书架
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
        <button class="carousel-prev" @click="prevSlide"><i class="fa fa-chevron-left"></i></button>
        <button class="carousel-next" @click="nextSlide"><i class="fa fa-chevron-right"></i></button>
        <div class="carousel-dots">
          <span 
            v-for="(comic, index) in popularComics" 
            :key="index"
            class="dot"
            :class="{ active: index === carouselIndex }"
            @click="carouselIndex = index"
          ></span>
        </div>
      </div>
    </div>

    <!-- 最新更新 -->
    <div class="latest-updates-section">
      <div class="section-header">
        <h2>最新更新</h2>
      </div>
      <div class="comics-grid">
        <div 
          v-for="comic in latestUpdates" 
          :key="comic.id"
          class="comic-card"
        >
          <div class="comic-cover-container">
            <img :src="comic.image" :alt="comic.title" class="comic-cover">
            <div class="cover-overlay">
              <button class="quick-read-btn">
                <i class="fa fa-book-open"></i>
              </button>
            </div>
            <div class="new-update-badge">更新</div>
            <div class="rating-badge">{{ comic.rating }}</div>
          </div>
          <div class="comic-info">
            <h3 class="comic-title">{{ comic.title }}</h3>
            <p class="comic-author">{{ comic.author }}</p>
            <p class="comic-latest-chapter">{{ comic.latestChapter }}</p>
            <div class="comic-stats">
              <span class="stat-item">{{ comic.readers }}万阅读</span>
              <span class="stat-item">{{ comic.follows }}万追漫</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 热门完结 -->
    <div class="completed-comics-section">
      <div class="section-header">
        <h2>热门完结</h2>
      </div>
      <div class="comics-grid">
        <div 
          v-for="comic in completedComics" 
          :key="comic.id"
          class="comic-card"
        >
          <div class="comic-cover-container">
            <img :src="comic.image" :alt="comic.title" class="comic-cover">
            <div class="cover-overlay">
              <button class="quick-read-btn">
                <i class="fa fa-book-open"></i>
              </button>
            </div>
            <div class="completed-badge">已完结</div>
            <div class="rating-badge">{{ comic.rating }}</div>
          </div>
          <div class="comic-info">
            <h3 class="comic-title">{{ comic.title }}</h3>
            <p class="comic-author">{{ comic.author }}</p>
            <p class="comic-total-chapters">{{ comic.totalChapters }}话全</p>
            <div class="comic-stats">
              <span class="stat-item">{{ comic.readers }}万阅读</span>
              <span class="stat-item">{{ comic.follows }}万追漫</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 漫画排行榜 -->
    <div class="comic-ranking-section">
      <div class="section-header">
        <h2>漫画排行榜</h2>
        <div class="ranking-tabs">
          <button 
            v-for="tab in rankingTabs" 
            :key="tab.id"
            class="ranking-tab"
            :class="{ active: activeRankingTab === tab.id }"
            @click="activeRankingTab = tab.id"
          >
            {{ tab.name }}
          </button>
        </div>
      </div>
      <div class="ranking-list">
        <div 
          v-for="(comic, index) in topComics" 
          :key="comic.id"
          class="ranking-item"
          :class="{ 'top-three': index < 3 }"
        >
          <div class="rank-number" :class="{ 'highlight': index < 3 }">
            {{ index + 1 }}
          </div>
          <img :src="comic.image" :alt="comic.title" class="rank-cover">
          <div class="rank-info">
            <h3 class="rank-title">{{ comic.title }}</h3>
            <p class="rank-author">{{ comic.author }}</p>
            <div class="rank-genres">
              <span 
                v-for="genre in comic.genres.slice(0, 2)" 
                :key="genre"
                class="mini-genre-tag"
              >
                {{ genre }}
              </span>
            </div>
            <div class="rank-stats">
              <span class="rank-rating">{{ comic.rating }}分</span>
              <span class="rank-readers">{{ comic.readers }}万阅读</span>
            </div>
          </div>
          <button class="rank-read-btn">阅读</button>
        </div>
      </div>
    </div>

    <!-- 精选专题 -->
    <div class="comic-topics-section">
      <div class="section-header">
        <h2>精选专题</h2>
      </div>
      <div class="topics-grid">
        <div 
          v-for="topic in comicTopics" 
          :key="topic.id"
          class="topic-card"
        >
          <div class="topic-image-container">
            <img :src="topic.image" :alt="topic.title" class="topic-image">
            <div class="topic-overlay">
              <h3 class="topic-title">{{ topic.title }}</h3>
              <p class="topic-count">{{ topic.count }}部漫画</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import logoImage from '@/assets/logo.png'

export default {
  name: 'ComicView',
  data() {
    return {
      // 分类数据
      categories: [
        { id: 'all', name: '全部' },
        { id: 'action', name: '热血' },
        { id: 'romance', name: '恋爱' },
        { id: 'fantasy', name: '奇幻' },
        { id: 'comedy', name: '搞笑' },
        { id: 'slice-of-life', name: '日常' },
        { id: 'sci-fi', name: '科幻' },
        { id: 'horror', name: '恐怖' },
        { id: 'mystery', name: '悬疑' },
        { id: 'shounen', name: '少年' },
        { id: 'shoujo', name: '少女' },
      ],
      activeCategory: 'all',
      
      // 轮播图索引
      carouselIndex: 0,
      
      // 排行榜标签
      rankingTabs: [
        { id: 'daily', name: '日榜' },
        { id: 'weekly', name: '周榜' },
        { id: 'monthly', name: '月榜' },
        { id: 'all-time', name: '总榜' },
      ],
      activeRankingTab: 'daily',
      
      // 热门漫画（轮播）
      popularComics: [
        {
          id: 1,
          title: '斗破苍穹',
          image: logoImage,
          rating: 9.6,
          author: '天蚕土豆',
          status: '连载中',
          updateFrequency: '每周更新',
          genres: ['热血', '玄幻', '动作'],
          description: '天才少年萧炎在家族中遭遇挫折，失去修炼能力，却意外获得药老相助，开启了一段传奇逆袭之路。',
        },
        {
          id: 2,
          title: '一人之下',
          image: logoImage,
          rating: 9.5,
          author: '米二',
          status: '连载中',
          updateFrequency: '每周更新',
          genres: ['玄幻', '动作', '冒险'],
          description: '平凡少年张楚岚为解开爷爷和自己身上的秘密，与冯宝宝一同进入异人世界，卷入了前所未有的风波。',
        },
        {
          id: 3,
          title: '哑舍',
          image: logoImage,
          rating: 9.3,
          author: '玄色',
          status: '连载中',
          updateFrequency: '不定期更新',
          genres: ['奇幻', '历史', '古风'],
          description: '一家名为哑舍的古董店，每一件古董都有自己的故事，店主与客人之间的奇妙缘分由此展开。',
        },
      ],
      
      // 最新更新
      latestUpdates: [
        {
          id: 101,
          title: '星辰变',
          author: '我吃西红柿',
          image: logoImage,
          rating: 9.2,
          latestChapter: '第567话 星辰之力',
          readers: 1560,
          follows: 890,
        },
        {
          id: 102,
          title: '全职高手',
          author: '蝴蝶蓝',
          image: logoImage,
          rating: 9.4,
          latestChapter: '第432话 荣耀归来',
          readers: 1890,
          follows: 1020,
        },
        {
          id: 103,
          title: '鬼灭之刃',
          author: '吾峠呼世晴',
          image: logoImage,
          rating: 9.7,
          latestChapter: '第205话 羁绊',
          readers: 2450,
          follows: 1560,
        },
        {
          id: 104,
          title: '海贼王',
          author: '尾田荣一郎',
          image: logoImage,
          rating: 9.8,
          latestChapter: '第1090话 新的征程',
          readers: 3680,
          follows: 2450,
        },
      ],
      
      // 热门完结
      completedComics: [
        {
          id: 201,
          title: '火影忍者',
          author: '岸本齐史',
          image: logoImage,
          rating: 9.6,
          totalChapters: 700,
          readers: 4520,
          follows: 2890,
        },
        {
          id: 202,
          title: '进击的巨人',
          author: '谏山创',
          image: logoImage,
          rating: 9.5,
          totalChapters: 139,
          readers: 3250,
          follows: 2140,
        },
        {
          id: 203,
          title: '死神',
          author: '久保带人',
          image: logoImage,
          rating: 9.2,
          totalChapters: 686,
          readers: 2890,
          follows: 1870,
        },
        {
          id: 204,
          title: '东京喰种',
          author: '石田翠',
          image: logoImage,
          rating: 9.0,
          totalChapters: 143,
          readers: 2560,
          follows: 1680,
        },
      ],
      
      // 漫画排行榜
      topComics: [
        {
          id: 301,
          title: '斗破苍穹',
          author: '天蚕土豆',
          image: logoImage,
          rating: 9.6,
          readers: 3680,
          genres: ['热血', '玄幻', '动作'],
        },
        {
          id: 302,
          title: '一人之下',
          author: '米二',
          image: logoImage,
          rating: 9.5,
          readers: 3250,
          genres: ['玄幻', '动作', '冒险'],
        },
        {
          id: 303,
          title: '全职高手',
          author: '蝴蝶蓝',
          image: logoImage,
          rating: 9.4,
          readers: 2890,
          genres: ['电竞', '热血', '职场'],
        },
        {
          id: 304,
          title: '鬼灭之刃',
          author: '吾峠呼世晴',
          image: logoImage,
          rating: 9.7,
          readers: 3450,
          genres: ['热血', '奇幻', '冒险'],
        },
        {
          id: 305,
          title: '星辰变',
          author: '我吃西红柿',
          image: logoImage,
          rating: 9.2,
          readers: 2560,
          genres: ['玄幻', '修真', '冒险'],
        },
      ],
      
      // 精选专题
      comicTopics: [
        {
          id: 401,
          title: '热门国漫推荐',
          image: logoImage,
          count: 25,
        },
        {
          id: 402,
          title: '经典日漫回顾',
          image: logoImage,
          count: 20,
        },
        {
          id: 403,
          title: '恋爱甜漫合集',
          image: logoImage,
          count: 18,
        },
        {
          id: 404,
          title: '热血战斗漫画',
          image: logoImage,
          count: 22,
        },
      ],
    }
  },
  mounted() {
    // 自动轮播
    this.carouselInterval = setInterval(() => {
      this.nextSlide()
    }, 5000)
  },
  beforeUnmount() {
    // 清除轮播定时器
    if (this.carouselInterval) {
      clearInterval(this.carouselInterval)
    }
  },
  methods: {
    // 轮播图控制
    prevSlide() {
      this.carouselIndex = (this.carouselIndex - 1 + this.popularComics.length) % this.popularComics.length
    },
    nextSlide() {
      this.carouselIndex = (this.carouselIndex + 1) % this.popularComics.length
    },
  },
}
</script>

<style scoped>
/* 漫画页面容器 */
.comic-container {
  min-height: 100vh;
  background-color: #f8f9fa;
  padding-bottom: 50px;
}

/* 头部banner */
.comic-banner {
    position: relative;
    height: 450px;
    background-image: url('/src/assets/动漫.png');
    background-size: cover;
    background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4));
}

.banner-content {
  position: relative;
  text-align: center;
  color: white;
  z-index: 1;
  padding: 0 20px;
}

.banner-title {
  font-size: 56px;
  font-weight: bold;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.banner-subtitle {
  font-size: 24px;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 分类标签 */
.comic-categories {
  background-color: white;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.comic-categories::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.category-tab:hover {
  color: #9c27b0;
}

.category-tab.active {
  color: white;
  background-color: #9c27b0;
}

/* 通用区域样式 */
.popular-comics-section,
.latest-updates-section,
.completed-comics-section,
.comic-ranking-section,
.comic-topics-section {
  margin: 30px 20px;
  background-color: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.more-link {
  color: #9c27b0;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.more-link:hover {
  text-decoration: underline;
}

/* 轮播图样式 */
.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-item {
  flex: 0 0 100%;
}

.comic-card-large {
  display: flex;
  gap: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.comic-cover-large {
  width: 300px;
  height: 450px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comic-info-large {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.comic-rating {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.rating-number {
  font-size: 48px;
  font-weight: bold;
  color: #9c27b0;
}

.rating-text {
  font-size: 16px;
  color: #666;
}

.comic-title-large {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 16px;
  color: #333;
}

.comic-description {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  margin-bottom: 20px;
}

.comic-details {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.detail-item {
  font-size: 14px;
  color: #999;
  padding: 4px 12px;
  background-color: #e9ecef;
  border-radius: 12px;
}

.comic-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.genre-tag {
  padding: 6px 16px;
  background-color: #9c27b0;
  color: white;
  border-radius: 16px;
  font-size: 14px;
}

.comic-actions {
  display: flex;
  gap: 16px;
}

.read-now-btn,
.add-bookshelf-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.read-now-btn {
  background-color: #9c27b0;
  color: white;
}

.read-now-btn:hover {
  background-color: #7b1fa2;
  transform: translateY(-2px);
}

.add-bookshelf-btn {
  background-color: white;
  color: #9c27b0;
  border: 2px solid #9c27b0;
}

.add-bookshelf-btn:hover {
  background-color: #9c27b0;
  color: white;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
}

.carousel-prev {
  left: 20px;
}

.carousel-next {
  right: 20px;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background-color: white;
  width: 32px;
  border-radius: 6px;
}

/* 漫画网格 */
.comics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.comic-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.comic-card:hover {
  transform: translateY(-4px);
}

.comic-cover-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 12px;
}

.comic-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.comic-cover-container:hover .comic-cover {
  transform: scale(1.05);
}

.cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.comic-cover-container:hover .cover-overlay {
  opacity: 1;
}

.quick-read-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 24px;
  color: #9c27b0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-read-btn:hover {
  background-color: white;
  transform: scale(1.1);
}

.new-update-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background-color: #ff6b6b;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.completed-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  background-color: #4CAF50;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.rating-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  background-color: #9c27b0;
  color: white;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
}

.comic-info {
  padding: 0 4px;
}

.comic-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #333;
  line-height: 1.3;
}

.comic-author {
  font-size: 14px;
  color: #999;
  margin-bottom: 4px;
}

.comic-latest-chapter,
.comic-total-chapters {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comic-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #ccc;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 排行榜样式 */
.ranking-tabs {
  display: flex;
  gap: 16px;
}

.ranking-tab {
  padding: 6px 16px;
  border: none;
  background: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.ranking-tab:hover {
  color: #9c27b0;
}

.ranking-tab.active {
  color: white;
  background-color: #9c27b0;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background-color: #f8f9fa;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.ranking-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ranking-item.top-three {
  background-color: #f3e5f5;
}

.rank-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

.rank-number.highlight:nth-child(1) {
  background-color: #FFD700;
  color: white;
}

.rank-number.highlight:nth-child(2) {
  background-color: #C0C0C0;
  color: white;
}

.rank-number.highlight:nth-child(3) {
  background-color: #CD7F32;
  color: white;
}

.rank-cover {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.rank-info {
  flex: 1;
}

.rank-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 4px;
  color: #333;
}

.rank-author {
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}

.rank-genres {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-genre-tag {
  padding: 2px 8px;
  background-color: #e9ecef;
  color: #666;
  border-radius: 8px;
  font-size: 12px;
}

.rank-stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.rank-rating {
  color: #9c27b0;
  font-weight: bold;
}

.rank-readers {
  color: #666;
}

.rank-read-btn {
  padding: 8px 24px;
  background-color: #9c27b0;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.rank-read-btn:hover {
  background-color: #7b1fa2;
}

/* 专题样式 */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.topic-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.topic-image-container {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.topic-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.topic-card:hover .topic-image {
  transform: scale(1.05);
}

.topic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}

.topic-title {
  font-size: 20px;
  font-weight: bold;
  color: white;
  margin-bottom: 4px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.topic-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .banner-title {
    font-size: 40px;
  }
  
  .banner-subtitle {
    font-size: 20px;
  }
  
  .comic-card-large {
    flex-direction: column;
    align-items: center;
  }
  
  .comic-cover-large {
    width: 240px;
    height: 360px;
  }
  
  .comic-info-large {
    width: 100%;
  }
  
  .comic-title-large {
    font-size: 28px;
  }
  
  .ranking-item {
    flex-direction: column;
    text-align: center;
  }
  
  .rank-info {
    width: 100%;
  }
  
  .comics-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .ranking-tabs {
    gap: 8px;
  }
  
  .ranking-tab {
    padding: 4px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .banner-title {
    font-size: 32px;
  }
  
  .banner-subtitle {
    font-size: 16px;
  }
  
  .comic-categories {
    padding: 12px;
    gap: 8px;
  }
  
  .category-tab {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  .comics-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
  
  .topics-grid {
    grid-template-columns: 1fr;
  }
}
</style>